transaction: add contextual logging with start_ts (#267)#548
Conversation
Enrich the transaction lifecycle, plan/retry, and region-cache logging with each transaction's start_ts and region/store context; add commit/rollback outcome logs, log dropping an active transaction under all check levels, and a terminal warn when region-error retries are exhausted. Truncate keys in the one full-key error log. Fix message typos/duplicates and remove dead logger-threading comments. Add a dependency-free capture-logger test and a RUST_LOG note to the README. Refs tikv#267 Signed-off-by: Eduard Ralph <eduard@ralphovi.net>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR expands logging across client operations, region retries, cache updates, and transaction/2PC lifecycles. It adds contextual timestamps and durations, hexadecimal key formatting, log-capture tests, and README guidance for configuring log output. ChangesLogging improvements
Estimated code review effort: 2 (Simple) | ~15 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
format_key_for_log printed the prefix with {:?} on a byte slice, which
renders as a decimal array (prefix=[104, 101, 108, 108, 111]). Format it
with kv::HexRepr instead so it reads as prefix=68656C6C6F, matching how
Key and KvPair already render bytes in their Debug impls.
Refs tikv#267
Signed-off-by: Eduard Ralph <eduard@ralphovi.net>
feff589 to
56fb14c
Compare
Enrich the transaction lifecycle, plan/retry, and region-cache logging with each transaction's start_ts and region/store context; add commit/rollback outcome logs, log dropping an active transaction under all check levels, and a terminal warn when region-error retries are exhausted. Truncate keys in the one full-key error log. Fix message typos/duplicates and remove dead logger-threading comments. Add a dependency-free capture-logger test and a RUST_LOG note to the README.
Refs #267
Signed-off-by: Eduard Ralph eduard@ralphovi.net
Summary by CodeRabbit
RUST_LOG, and how log levels correspond to transaction lifecycle and operational/error events.